﻿using BMC.ARSystem;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Wicresoft.EKA.NRemedy.CodeGenerate
{
    public class GeneratePropertyBase : IGenerateProperty
    {
        public virtual void Create(CodeTypeDeclaration classType, string propertyName, string propertyType, Limit limit, Dictionary<string, object> attributePropertyValues, GeneratePropertyDelegate propertyDelegate, IGeneratePropertyAttribute attributeGenerator)
        {
            CodeMemberField _field_ID = new CodeMemberField();
            _field_ID.Name = propertyName+"_ID";
            _field_ID.Type = new CodeTypeReference(typeof(uint));
            _field_ID.Attributes = MemberAttributes.Public| MemberAttributes.Const;
            _field_ID.InitExpression = new CodePrimitiveExpression((uint)attributePropertyValues["DatabaseID"]);

            CodeMemberField _field_Name = new CodeMemberField();
            _field_Name.Name = propertyName + "_Name";
            _field_Name.Type = new CodeTypeReference(typeof(string));
            _field_Name.Attributes = MemberAttributes.Public | MemberAttributes.Const;
            _field_Name.InitExpression = new CodePrimitiveExpression((string)attributePropertyValues["DatabaseName"]);

            classType.Members.Add(_field_ID);
            classType.Members.Add(_field_Name);
        }
    }
}
